﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Model;
using AspNetCs.Bll;
using System.Data;
using System.Collections;
using AspNetCs.Enumerations;
using AspNetCs.Enumerations.memorial_enum;
using AspNetCs.Enumerations.User_Enum;
using AspNetCs.Common;
using AspNetCs.Enumerations.Channel_Enum;


public partial class Users_HistoryPhoto : BasePage
{
    protected string types = "";
    protected string channelId = "";
    protected string photoClass = "";

    protected string topPhotoPath="";

    private NetMuBLL bll = new NetMuBLL();
    protected void Page_Load(object sender, EventArgs e)
    {
       // CheckUserExit("Login.Aspx?ReUrl=" + configInfo.InstallDir + "Users/HistoryPhoto.aspx", "请您登录", true);
        if (!IsPostBack)
        {
            types = Request["types"];
            channelId = Request["channelId"];
            photoClass = Request["photoClass"];
            if ((!string.IsNullOrEmpty(types)) && (!string.IsNullOrEmpty(channelId)) && (!string.IsNullOrEmpty(photoClass)))
            {
                ViewState["types"] = types;
                ViewState["channelId"] = channelId;
                ViewState["photoClass"] = photoClass;
                if(StringHelper.isNumber_int(photoClass)==1)
                {
                    topPhotoPath=configInfo.InstallDir+"Images/historyphoto.jpg";
                }
                else if (StringHelper.isNumber_int(photoClass) == 2)
                {
                    topPhotoPath = configInfo.InstallDir + "Images/historyphoto2.jpg";
                }



            }
            else
            {
                ResultStr("Login.aspx", "参数错误");
            }

            dataBind();
        }
        else
        { 
            if(ViewState["types"]!=null&&ViewState["channelId"]!=null&&ViewState["photoClass"]!=null)
            {
                types=ViewState["types"].ToString();
                channelId =ViewState["channelId"].ToString();
                photoClass=ViewState["photoClass"].ToString();

            }
        }

    }

    protected void dataBind()
    {
        string cmdText = "select * from UserPhoto where IsDel=0 and ClassID="+StringHelper.isNumber_int(photoClass)+" and Types="+StringHelper.isNumber_int(types)+" and ChannelId="+StringHelper.isNumber_int(channelId)+" order by id desc";
        AspNetCs.Common.DataPagesOperate operate = new DataPagesOperate();

        operate.BindRepeater(cmdText, AspNetPager1, "id desc", "id", rptNetMus);


    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        dataBind();
    }


}
